package br.gov.capgov.treinamento.jpa.entidades;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

@Entity(name="info_url")
@NamedQuery(name="InfoUrl.findAll", query="SELECT q FROM info_url q")
public class InfoUrl implements Serializable
{
	private static final long serialVersionUID = 1L;
	
	@Id 
	@SequenceGenerator(name="info_url_id_GENERATOR", sequenceName="info_url_id_seq", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="info_url_id_GENERATOR") 
	private Integer id;
	
	@Column(name="data_hora")
	@Temporal(value=TemporalType.TIMESTAMP)
	private Date dataHora;
	
	@Column(name="tempo_resposta")
	private long temp_resp;	
	
	@Column(name="disponivel")
	private boolean disponivel=true;
	
	@ManyToOne
	@JoinColumn(name="url_id", referencedColumnName="id")
	private Url url;

	public InfoUrl()
	{	
	}

	public Integer getId()
	{
		return id;
	}
	public void setId(Integer id)
	{
		this.id = id;
	}
	public Date getDataHora()
	{
		return dataHora;
	}
	public void setDataHora(Date dataHora)
	{
		this.dataHora = dataHora;
	}
	public long getTemp_resp()
	{
		return temp_resp;
	}
	public void setTemp_resp(long temp_resp)
	{
		this.temp_resp = temp_resp;
	}
	public boolean isDisponivel()
	{
		return disponivel;
	}
	public void setDisponivel(boolean disponivel)
	{
		this.disponivel = disponivel;
	}
	public Url getUrl()
	{
		return url;
	}
	public void setUrl(Url url)
	{
		this.url = url;
	}	
}